//------------------------------------------------------------------------------
// X2D Game Engine
// Copyright (C) 2006-2007 Janusz Kowalski
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------

#include "imgSDL.h"
#include "RawVector.h"

#ifndef X2D_ANIM_H
#define X2D_ANIM_H

namespace x2d {

class Anim {
  public:
    Anim();
    virtual ~Anim();
    virtual SDL_Surface *getSurf();
    virtual Image &getImage() = 0;
};

class FrameAnim : public Anim {
  private:
    // Vector?
    RawVector<Image> frame_;
    RawVector<int> duration_;
    int startTime_;
    int total_;
  public:
    FrameAnim();
    FrameAnim(const char *path);
    void load(const char *path);
    virtual SDL_Surface *getSurf();
    virtual Image& getImage();
};

class NoAnim : public Anim {
  private:
    Image img_;
  public:
    NoAnim(const char *path);
    virtual SDL_Surface *getSurf();
    virtual Image& getImage();
};

} // namespace x2d

#endif
